<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>来扎堆</title>
    <#include "../common/header.ftl"/>
</head>
<body>
<!-- 导航条 -->
<#include "../common/navbar.ftl"/>

<div class="container">
    <div class="panel">
        <div class="panel-body">
            <ul class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active"><a href="#">全部</a></li>
                <li role="presentation"><a href="#">精品活动</a></li>

                <li class="pull-right">
                    <ul class="pagination" style="margin: 0">
                        <li><a href="#">&laquo;</a></li>
                        <li><a href="#">1</a></li>
                        <li><a href="#">2</a></li>
                        <li><a href="#">3</a></li>
                        <li><a href="#">4</a></li>
                        <li><a href="#">5</a></li>
                        <li><a href="#">&raquo;</a></li>
                        <li style="margin-left: 15px;">
                            <a href="${base}/forum/forumpost/index.jhtml" style="margin: 0;padding: 0;float: none;border: none;line-height: 1">
                                <button id="btnOpenForumPost" type="button" class="btn btn-primary">发布</button>
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>

            <table id="forumPostTable" class="table" style="margin: 10px;">
                <thead>
                    <tr>
                        <th>主题</th>
                        <th style="width: 148px;text-align: center;">作者</th>
                        <th style="width: 57px;text-align: center;">点击数</th>
                        <th style="width: 64px;text-align: center;">回复数</th>
                        <th style="width: 120px;text-align: center;">最后发表</th>
                    </tr>
                </thead>
                <tbody>

                </tbody>
            </table>
        </div>
    </div>
</div>

<!-- 底部介绍 -->
<jsp:include page="common/help_nav.jsp"/>
<#include "../common/help_nav.ftl"/>

<!-- 底部 -->
<#include "../common/footer.ftl"/>

<script type="text/javascript">
    $(function () {
        $.post('${base}/forum_post/list.html', {}, function(data) {
            var rows = data.rows;
            for(var i = 0; i < rows.length; i++) {
                var $row = $('<tr>' +
                        '<td><a href="${base}/forum_post/look.html?postId=' + rows[i]['postId'] + '"> ' + rows[i]['subject'] + '</a></td>' +
                        '<td class="text-center">' + rows[i]['user']['telNum'] + '</td>' +
                        '<td class="text-center">' + rows[i]['clickCount'] + '</td>' +
                        '<td class="text-center">' + rows[i]['replayCount'] + '</td>' +
                        '<td class="text-center">' + rows[i]['lastReplayDate'] + '</td>' +
                        '</tr>');
                $('#forumPostTable').find('tbody').append($row);
            }
        });
    });
</script>
</body>
</html>